package project02.domain;

import java.io.Serializable;
import java.util.Date;

public class User implements Serializable {
//    private long serialVersionUID = 1L;
    private String uid;
    private String password;//密码
    private String name;//姓名
    private Integer age;//年龄
    private String sex;//性别
    private String phoneNumber;//电话
    private String department;//所在院系
    private Date credit_rating;//注册日期
    private Integer balance=0;//用户余额
    private String birthday;//生日
    private Integer level=5;
    private boolean alive=true;

    public User() {
    }

    public User(String uid, String password, String name, Integer age, String sex, String phoneNumber, String department, Date credit_rating, Integer balance, String birthday, Integer level) {
        this.uid = uid;
        this.password = password;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.phoneNumber = phoneNumber;
        this.department = department;
        this.credit_rating = credit_rating;
        this.balance = balance;
        this.birthday = birthday;
        this.level = level;
    }


    public User(String uid, String name, String passWord, String sex, String phone, String department, Date credit_rating, String birthday) {
        this.uid = uid;
        this.password = passWord;
        this.name = name;
        this.age = 0;
        this.sex = sex;
        this.phoneNumber = phone;
        this.department = department;
        this.credit_rating = credit_rating;
        this.balance = 0;
        this.birthday = birthday;
    }

    public boolean isAlive() {
        return alive;
    }

    public void setAlive(boolean alive) {
        this.alive = alive;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public Date getCredit_rating() {
        return credit_rating;
    }

    public void setCredit_rating(Date credit_rating) {
        this.credit_rating = credit_rating;
    }

    public Integer getBalance() {
        return balance;
    }

    public void setBalance(Integer balance) {
        this.balance = balance;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;

    }

    @Override
    public String toString() {
        return "User{" +
                "uid='" + uid + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", department='" + department + '\'' +
                ", credit_rating=" + credit_rating +
                ", balance=" + balance +
                ", birthday='" + birthday + '\'' +
                ", level=" + level +
                ", alive=" + alive +
                '}';
    }
}
